package com.sec.util;

import java.util.ArrayList;
import java.util.Collections;

import android.gesture.Prediction;
import android.os.Bundle;

public class CommonHelper {
	
	public String[] sortPredictions(ArrayList<Prediction> predictions){		
		ArrayList<Prediction> list = new ArrayList<Prediction>();
		for(int i=0;i<predictions.size();i++){
			if(predictions.get(i).score>1.0 && !Double.isNaN(predictions.get(i).score)){
				list.add(predictions.get(i));
			}	
		}
		Collections.sort(list, new ComparatorPredictions());
		String[] pnames = new String[list.size()];
		for(int i=0;i<list.size();i++){
			pnames[i] = list.get(i).name;	
		}
		return pnames;
		
		
		
	}
	
}
